<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>embedme: NSemaphore类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">embedme
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.8 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li class="current"><a href="annotated.html"><span>类</span></a></li>
      <li><a href="files.html"><span>文件</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>类列表</span></a></li>
      <li><a href="classes.html"><span>类索引</span></a></li>
      <li><a href="hierarchy.html"><span>类继承关系</span></a></li>
      <li><a href="functions.html"><span>类成员</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="class_n_semaphore-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">NSemaphore类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>有名信号量,一般用于进程间通信  
 <a href="class_n_semaphore.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="_semaphore_8h_source.html">Semaphore.h</a>&gt;</code></p>
<div class="dynheader">
类 NSemaphore 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_n_semaphore.png" usemap="#NSemaphore_map" alt=""/>
  <map id="NSemaphore_map" name="NSemaphore_map">
<area href="class_semaphore.html" title="信号量抽象类(基于POSIX接口) " alt="Semaphore" shape="rect" coords="0,0,85,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:aea2a1d431eafa1f10a683fe695b1f53c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aea2a1d431eafa1f10a683fe695b1f53c"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>NSemaphore</b> (char *name)</td></tr>
<tr class="separator:aea2a1d431eafa1f10a683fe695b1f53c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a67253f622b2404157b6313d15eec1470"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_semaphore.html#a67253f622b2404157b6313d15eec1470">open</a> (sint32 value=1)</td></tr>
<tr class="memdesc:a67253f622b2404157b6313d15eec1470"><td class="mdescLeft">&#160;</td><td class="mdescRight">打开有名信号量  <a href="#a67253f622b2404157b6313d15eec1470">更多...</a><br /></td></tr>
<tr class="separator:a67253f622b2404157b6313d15eec1470"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8941ffed3c951d2cc5d6f63b29df3b50"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_semaphore.html#a8941ffed3c951d2cc5d6f63b29df3b50">close</a> ()</td></tr>
<tr class="memdesc:a8941ffed3c951d2cc5d6f63b29df3b50"><td class="mdescLeft">&#160;</td><td class="mdescRight">关闭有名信号量  <a href="#a8941ffed3c951d2cc5d6f63b29df3b50">更多...</a><br /></td></tr>
<tr class="separator:a8941ffed3c951d2cc5d6f63b29df3b50"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_semaphore"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_semaphore')"><img src="closed.png" alt="-"/>&#160;Public 成员函数 继承自 <a class="el" href="class_semaphore.html">Semaphore</a></td></tr>
<tr class="memitem:acbb526dfd6fa98bc2068652f5a61c661 inherit pub_methods_class_semaphore"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_semaphore.html#acbb526dfd6fa98bc2068652f5a61c661">wait</a> ()</td></tr>
<tr class="memdesc:acbb526dfd6fa98bc2068652f5a61c661 inherit pub_methods_class_semaphore"><td class="mdescLeft">&#160;</td><td class="mdescRight">等待信号量  <a href="#acbb526dfd6fa98bc2068652f5a61c661">更多...</a><br /></td></tr>
<tr class="separator:acbb526dfd6fa98bc2068652f5a61c661 inherit pub_methods_class_semaphore"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7cbb633dbb25fa8c95c2a640a8ed16a2 inherit pub_methods_class_semaphore"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_semaphore.html#a7cbb633dbb25fa8c95c2a640a8ed16a2">tryWait</a> ()</td></tr>
<tr class="memdesc:a7cbb633dbb25fa8c95c2a640a8ed16a2 inherit pub_methods_class_semaphore"><td class="mdescLeft">&#160;</td><td class="mdescRight">尝试等待信号量  <a href="#a7cbb633dbb25fa8c95c2a640a8ed16a2">更多...</a><br /></td></tr>
<tr class="separator:a7cbb633dbb25fa8c95c2a640a8ed16a2 inherit pub_methods_class_semaphore"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae97c8e0073930baaf3d39259bd87606a inherit pub_methods_class_semaphore"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_semaphore.html#ae97c8e0073930baaf3d39259bd87606a">post</a> ()</td></tr>
<tr class="memdesc:ae97c8e0073930baaf3d39259bd87606a inherit pub_methods_class_semaphore"><td class="mdescLeft">&#160;</td><td class="mdescRight">释放信号量  <a href="#ae97c8e0073930baaf3d39259bd87606a">更多...</a><br /></td></tr>
<tr class="separator:ae97c8e0073930baaf3d39259bd87606a inherit pub_methods_class_semaphore"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac02e23031c9521649a5ff7618d03fb93 inherit pub_methods_class_semaphore"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_semaphore.html#ac02e23031c9521649a5ff7618d03fb93">getValue</a> (sint32 &amp;value)</td></tr>
<tr class="memdesc:ac02e23031c9521649a5ff7618d03fb93 inherit pub_methods_class_semaphore"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取信号量值  <a href="#ac02e23031c9521649a5ff7618d03fb93">更多...</a><br /></td></tr>
<tr class="separator:ac02e23031c9521649a5ff7618d03fb93 inherit pub_methods_class_semaphore"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
额外继承的成员函数</h2></td></tr>
<tr class="inherit_header pro_attribs_class_semaphore"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_class_semaphore')"><img src="closed.png" alt="-"/>&#160;Protected 属性 继承自 <a class="el" href="class_semaphore.html">Semaphore</a></td></tr>
<tr class="memitem:a6d28483c923c2aafebed053ccd77d301 inherit pro_attribs_class_semaphore"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6d28483c923c2aafebed053ccd77d301"></a>
sem_t&#160;</td><td class="memItemRight" valign="bottom"><b>m_sem</b></td></tr>
<tr class="separator:a6d28483c923c2aafebed053ccd77d301 inherit pro_attribs_class_semaphore"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>有名信号量,一般用于进程间通信 </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a class="anchor" id="a8941ffed3c951d2cc5d6f63b29df3b50"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 NSemaphore::close </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>关闭有名信号量 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回STATUS_OK,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>当信号量不再使用时,请关闭.进程退出时也会自动关闭, 但关闭信号量不会真正删除信号量,删除需要使用sem_unlink. </dd></dl>

<p>实现了 <a class="el" href="class_semaphore.html">Semaphore</a>.</p>

</div>
</div>
<a class="anchor" id="a67253f622b2404157b6313d15eec1470"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 NSemaphore::open </td>
          <td>(</td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>value</em> = <code>1</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>打开有名信号量 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回STATUS_OK,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>信号量存在,则返回,不存在则创建,创建成功生成/tmp/sem.name </dd></dl>

<p>实现了 <a class="el" href="class_semaphore.html">Semaphore</a>.</p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>libemb/inc/<a class="el" href="_semaphore_8h_source.html">Semaphore.h</a></li>
<li>libemb/src/Semaphore.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2016年 七月 7日 星期四 19:49:39 , 为 embedme使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>
